﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace UniTax.Models
{
    public class TaxiModel
    {
        [HiddenInput(DisplayValue = false)]
        public int Id { get; set; }

        [Required]
        [StringLength(200)]
        [Display(Name = "Наименование службы такси")]
        public string Name { get; set; }

        [Required]
        [Display(Name = "Город")]
        [HiddenInput(DisplayValue = false)]
        public int TownId { get; set; }

        [Required]
        [Display(Name = "Окончание действия лицензии")]
        [DataType(DataType.Date)]
        public System.DateTime License { get; set; }

        [Display(Name = "Логотип")]
        [DataType(DataType.ImageUrl)]
        public byte[] Logo { get; set; }

        [HiddenInput(DisplayValue = false)]
        public string LogoMimeType { get; set; }

        [Display(Name = "Рейтинг")]
        public int Raiting { get; set; }

        [Display(Name = "Контактное лицо")]
        [StringLength(100)]
        public string ContactName { get; set; }

        [Display(Name = "Контактные телефоны")]
        public IEnumerable<ContactPhone> ContactPhones { get; set; }

        [Display(Name = "Функции")]
        public IEnumerable<Function> Functions { get; set; }

        [Display(Name = "Телефоны")]
        public IEnumerable<Phone> Phones { get; set; }

        [Display(Name = "Город")]
        public TownModel Town { get; set; }

        [HiddenInput(DisplayValue = false)]
        public IEnumerable<Function> AllFunctions { get; set; }
    }

    public class TaxiList
    {
        public IEnumerable<TaxiModel> Taxis { get; set; }
        public TownModel Town { get; set; }
    }
}